DMelt:DSP/5 Fast Wavelet Transform
From HandWiki
Limitted access. First login to DataMelt member area if you are a full DataMelt member.
Fast Wavelet Transform (FWT)
Here is FWT for 1D array using Haar method. We use Transform class for this task:
from math.jwave import Transform from math.jwave.transforms import * from math.jwave.transforms.wavelets import * t=Transform( FastWaveletTransform( Haar02( ) )) arrTime = [1, 10, 12, 8, 1, 1, 1, 1. ] arrFreq = t.forward( arrTime ) # 1-D FWT Haar forward print arrFreq.tolist() arrReco = t.reverse( arrFreq ) # 1-D FWT Haar reverse print arrReco.tolist()
The output of this code is:
[12.374368670764577, 9.545941546018389, -4.499, 0.0, -6.363, 2.8284, 0.0, 0.0] [1, 10, 12, 8, 1, 1, 1, 1. ]
FWT in 2D
Now let us consider a FWT transformation of 2D array. This is an extension of the above script:
No access. Members can view this part after login to DataMelt member area